package com.dgut.smart_house.mapper;

import com.dgut.smart_house.domain.Node;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface NodeMapper {

    @Select("select * from node")
    public List<Node> findAllNodes();

    @Select("select * from node where node_id=#{id}")
    public Node findByNodeId(@Param("id") Integer id);

    @Insert("insert into node(node_name,node_desc) values(node_name,desc)")
    public int creatNode(Node node);
}
